<template>
  <div id="integralDetailDialog">
    <el-dialog
      title="入量详情"
      :visible.sync="dialogData.isShow"
      width="900px"
      @close="closeAddDialog"
    >
      <!-- 表格部分 -->
     <el-table
        class="goods-data"
        :data="examineData"
        v-loading="examineLoading"
        border
        :row-style="{height:'30px'}"
        height="450"
        width="100%"
        ref="table"
      >
        <el-table-column type="index" label="序号" width="60" align="center" />
        <el-table-column label="大鹏号"   min-width="60" align="center" prop="dpAccount" />
        <el-table-column label="绑定手机号"   min-width="60" align="center" prop="mobile" />
        <el-table-column label="入量手机号"   min-width="60" align="center" prop="userChatCode" />
        <el-table-column label="入量时间"   min-width="60" align="center" prop="createTime" />
        <el-table-column label="是否成单"   min-width="60" align="center" prop="isOrderForm" >
          <template slot-scope="scope">
            <span v-if="scope.row.orderStatus === 'false'">否</span>
            <span v-if="scope.row.orderStatus === 'true'">是</span>
          </template>
        </el-table-column>

      </el-table>
      <!--分页-全局组件-->
      <pageCom
        :searchParams="examineSearchParams"
        :total="examineTotal"
        @searchList="examineSearchList"
      ></pageCom>
    </el-dialog>
  </div>
</template>

<script>
import  {getCollectLikesInfo} from  '@/api/operate/collectPraise.js'
export default {
  name: 'examineDialog',
  msg: '入量详情弹窗',
  props: ['dialogData'],
  data() {
    return {
      examineLoading: false,//集赞加载状态
      examineTotal: 0,//集赞
      examineData: [], // 集赞入量详情数据
      examineSearchParams: {
        pageNum: 1, // 当前页数
        pageSize: 10 // 页面显示条数
      },
      formInline: {
        activityId: '',
        userId:''
      }
    }
  },
  mounted() {
    this.formInline.activityId = this.dialogData.activityId
    this.formInline.userId = this.dialogData.userId
    this.examineSearchList()
  },
  methods: {
    /* 获取列表 */
    examineSearchList(){
      this.examineLoading = true
      //将列表查询的数据中的活动id和用户合信息并成一个对象,如果是第一次查询详情就将数据存储并查询,如果是第二次查询就将此储存好的数据再次覆盖
      let  params = Object.assign({}, this.examineSearchParams,this.formInline)
      getCollectLikesInfo(
        params,
        (response) => {
          this.examineLoading = false
          this.examineData = response.rows
          this.examineTotal = response.total
        },
        (response) => {
          this.$message({
            message: response.message,
            type: 'warning'
          })
          this.examineLoading = false
        }
      )
    },
    // 弹窗关闭事件
    closeAddDialog() {
      this.examineLoading = false
      this.dialogData.isShow = false
    }
  }
}
</script>

<style lang="less">
#integralDetailDialog {
  .el-table::before {
    height: 0;
  }
  .search-box {
    padding-left: 0 !important;
  }
  .greenText {
    color: #03aa87;
  }
  .redText {
    color: #f00;
  }
}
</style>
